//Rect.h - Class Rectangle

#ifndef _RECTANGLE_H_
#define _RECTANGLE_H_

#include <iostream>
#include "Point.h"
#include "Shape.h"
#include "Screen.h"

#include "CollisionsHandler.h"

using namespace std;

class Rect: public Shape
{
private:
	//data members
	int m_ver;	//vertical value of a rectangle
	int m_hor;	//horizontal value of a rectangle

public:
	Rect(const Point& point, int ver, int hor);	//constructor

	//seters
	void set(int x, int y, int ver, int hor);	//sets a rectangle by x and y values
	void set(const Point& point, int ver, int hor);		//sets a rectnagle by a point

	//geters
	int getVer() const { return m_ver; };
	int getHor() const { return m_hor; };
	Point getPoint() const { return m_point; };


	//virtual
	virtual void draw(char ch, bool isFullFill) const; //virtual draw for shape to screen
	virtual void drawToBuffer(char ch, bool isFullFill, bool isSplit, Screen& scr) const; //virtual draw for shape to buffer
	virtual bool isPointInside(const Point& point) const;	//vurtual checks if a shpe contains a point
	virtual bool isInScreenBoarder() const; //virtual chackes if the shape is in the screen boarders
	virtual void handleCollisions(Shape* otherShape); //virtual handels collisions between a shape and the other shapes

	void flipXmovement() { m_bucketHor *= (-1); } ; // changes the direction on the X axis
	void flipYmovement() { m_bucketVer *= (-1); } ; // changes the direction on the Y axis
};

#endif